package com.atguigu.boot.service;

import com.alibaba.druid.filter.AutoLoad;
import com.atguigu.boot.mapper.CustomerMapper;
import com.atguigu.boot.pojo.Customer;
import lombok.extern.slf4j.Slf4j;
import org.apache.ibatis.annotations.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * spring-boot
 * 2022/9/14 00 17
 */
@Service
public class CustomerService {

    @Resource
    private CustomerMapper customerMapper;

    public void add(Customer customer){
        customerMapper.add (customer);
    }

    public List<Customer> list(){

        return customerMapper.list ();
    }

    public Customer getCustomerById(Integer id){
        return customerMapper.getCustomerById (id);
    }

    public void deleteCustomerById(Integer id){
        customerMapper.deleteCustomerById (id);
    }

    public void updateCustomer(Customer customer){
        customerMapper.updateCustomer (customer);
    }
}
